<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html;charset=UTF-8" encoding="UTF-8">
    <h:head>

    </h:head>

    <h:body>

        <h:form id="form" enctype="multipart/form-data">

            <p:messages id="msgs" />

            <p:fileUpload id="fileupload"
                          value="#{fileUploadHandler.files}"
                          mode="simple" skinSimple="true" multiple="true" auto="true"
                          process="@this" update="msgs uploadedfiles"
                          listener="#{fileUploadHandler.handleFilesUpload}">
                <p:validateFile fileLimit="2" sizeLimit="100" virusScan="true" allowTypes="/(\.|\/)(csv)$/" />
            </p:fileUpload>

            <p:dataTable id="uploadedfiles" var="file" value="#{fileUploadView.uploadedFiles}">
                <p:column headerText="Name">
                    <h:outputText value="#{file.fileName}" />
                </p:column>

                <p:column headerText="Size">
                    <h:outputText value="#{file.size}" />
                </p:column>
            </p:dataTable>

        </h:form>

    </h:body>
</f:view>

</html>
